package com.bridgeintelligent.tag.webserver.dim.mgmt.service.export.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;

/**
 * @author JackCheung
 * @date 2020/7/10 5:23 PM.
 * description:
 */
@Getter
@Slf4j
public class ExcelListener<T> extends AnalysisEventListener<T> {

    private List<T> result = new ArrayList<>(100);

    @Override
    public void invoke(T object, AnalysisContext context) {
        result.add(object);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        log.info("解析excel完毕");
    }
}
